package com.briup.day07;

/**
 * @author lining
 * @date 2024/1/16 17:22
 */
public class TestPet {
    public static void main(String[] args) {
        //使用：不会相互影响  公共父类Object
        Dog dog = new Dog();
        Cat cat = new Cat();
        Fish fish = new Fish();
        //调用dog.toString()  地址值
        System.out.println(dog);
        //调用cat.toString()
        System.out.println(cat);
        //fish.toString()
        System.out.println(fish);

        System.out.println(dog.id);//0

        dog.id = 1;

        System.out.println(cat.id);//0
        System.out.println(fish.id);//0
        dog.eat();
        cat.eat();
        fish.eat();
    }
}
